<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
<div id="app">
    <!-- 1.修饰符 lazy 失去焦点或者点击回车时才会更新数据 -->
    <input type="text" v-model.lazy="message">
    <h2>{{message}}</h2>

    <!-- 2.修饰符 number 将input获得数据的类型固定为number类型 -->
    <input type="number" name="" id="" v-model.number="age">
    <h2>{{age}}--{{typeof age}}</h2>

    <!-- 3.修饰符 trim 将输入内容前后的空格去除 -->
    <input type="text" v-model.trim="name">
    <h2>{{name}}</h2>
</div>

<script src="../js/vue.js"></script>
<script>
    const app = new Vue({
        el: '#app',
        data: {
            message: 'Hello Vue!',
            age: '',
            name: ''
        }
    })
</script>
</body>
</html>